/*
** parse_path.c for 42sh in /home/demesy_j/svn/quarante-deuxsh/trunk
** 
** Made by julien demesy
** Login   <demesy_j@epitech.net>
** 
** Started on  Tue Mar 13 17:25:46 2012 julien demesy
** Last update Wed Mar 14 16:12:31 2012 julien demesy
*/

#include	<stdlib.h>
#include	<stdio.h>
#include	<string.h>
#include	"builtins.h"
#include	"list.h"

t_list		*create_path_list(t_list *env)
{
  char		*path;
  char		*buff;
  t_list	*list;

  path = my_getenv(env, "PATH");
  list = create_list();
  buff = strtok(path, ":");
  while (buff != NULL)
    {
      add_end(list, buff);
      buff = strtok(NULL, ":");
    }
  return (list);
}
